package com.ruoyi.produce.process.receiving.mapper;

import com.ruoyi.produce.process.receiving.domain.ReceivingReportCond;
import com.ruoyi.produce.process.receiving.domain.ReceivingReportDomain;
import com.ruoyi.produce.process.receiving.domain.ReceivingReportDto;
import com.ruoyi.produce.process.receiving.domain.productionLogReport;

import java.util.List;

/**
 * 验收单
 * 数据层
 */
public interface ReceivingReportMapper {
    /**
     * 查找验收单
     * @param cond
     * @return
     */
    List<ReceivingReportDto> selectReceivingReportList(ReceivingReportCond cond);

    /**
     * 查找未入库的验收单
     * @param cond
     * @return
     */
    List<ReceivingReportDto> selectNotWarehousedReceivingReportList(ReceivingReportCond cond);

    /**
     * 根据验收单编号查找
     * @param receivingReportId
     * @return
     */
    ReceivingReportDto selectReceivingReportById(String receivingReportId);

    /**
     * 根据加工单编号查找验收单记录
     * @param workSheetId
     * @return
     */
    List<ReceivingReportDto> selectReceivingReportByWorkSheetId(String workSheetId);

    /**
     * 获取最新的一条生产验收入库编号
     * @return
     */
    String getReceivingReportId();

    /**
     * 新增验收单
     * @param receivingReport
     * @return
     */
    int insertReceivingReport(ReceivingReportDomain receivingReport);

    /**
     * 更新验收单
     * @param receivingReport
     * @return
     */
    int updateReceivingReport(ReceivingReportDomain receivingReport);

    /**
     * 删除验收单
     * 仅更新验收单删除标志
     * @param receivingReport
     * @return
     */
    int updateReceivingReportDeleteFlag(ReceivingReportDomain receivingReport);

    /**
     * 更新审批状态
     * @param receivingReportId
     * @return
     */
    int completeApprovalFlag(String receivingReportId);

    /**
     * 拒绝审批状态
     * @param receivingReportId
     * @return
     */
    int refuseApprovalFlag(String receivingReportId);

    /**
     * 查找生产日报表
     * @param cond
     * @return
     */
    List<productionLogReport> selectProductionLogReport(ReceivingReportCond cond);
}
